package fuckjava;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class stringtest {

	
	public static void main(String[] args) {
		List<String> li = str2List("7", ",");
		for(String s : li) {
			System.out.println(s);
			System.out.println("******************");
		}
	}
	
	public static List<String> str2List(String str,String regex){
		String[] array = str.split(regex);
		if(array.length<=0) {
			return null;
		}
		List<String> resultList = new ArrayList<>(array.length);
		Collections.addAll(resultList,array);
		return resultList;
	}
}
